//package com.itheima.filter;
//
//
//import javax.servlet.*;
//import javax.servlet.annotation.WebFilter;
//import java.io.IOException;
//
///**
// * @author zhangbaiyan
// * @date 2024-10-01 21:19
// * @description:
// * @version:
// */
//@WebFilter(urlPatterns = "/*")
//public class DemoFilter implements Filter {
//    @Override //初始化方法,只调用一次
//    public void init(FilterConfig filterConfig) throws ServletException {
//        System.out.println("过滤器初始化");
//    }
//
//    @Override   //拦截请求之后调用
//    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
//        System.out.println("过滤器拦截请求");
//        //放行
//        filterChain.doFilter(servletRequest,servletResponse);
//    }
//
//    @Override   //销毁方法,只调用一次
//    public void destroy() {
//        System.out.println("过滤器销毁");
//    }
//}
